package com.dubito.encrypt.url;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

/**
 * @author liliang
 * @description:
 * @date 2018/5/17.
 */
public class UrlEncoder {

    public static void main(String[] args) throws UnsupportedEncodingException {
        String original = "URL 参数";
        // Url编码
        String encoded = URLEncoder.encode(original, "UTF-8");
        System.out.println(encoded);
        String ori = URLDecoder.decode(encoded, "UTF-8");
        System.out.println(ori);
    }
}
